<template>
  <div>
    <group v-if="todayTaskList.length">
      <cell v-for="(taskItem,idx) in todayTaskList" 
        :key="idx"
        :title="taskItem.taskName">
      </cell>
    </group>
    <group v-else>
      <cell title="今日没有代办任务"></cell>
    </group>
  </div>
</template>

<script>
import { mapState } from 'vuex'
import { format } from '@/util'
export default {
  name: 'Tab1',
  data () {
    return {
      today: '',
      todayTaskList:[]
    }
  },
  computed: {
    ...mapState(['dayTaskList','taskList'])
  },
  created(){
    this.today = format(new Date(),'YYYY/MM/DD')
    // console.log('this.taskDayObj.dayTaskList:',JSON.stringify(this.taskDayObj.dayTaskList,null,4))
    this.dayTaskList.forEach((item,idx)=>{
      // console.log('item:',JSON.stringify(item,null,4))
      if(item.day === this.today){
        this.todayTaskList = item.taskList
      }
    })
    // console.log('this.todayTaskList:',JSON.stringify(this.todayTaskList,null,4))
  },
  methods:{}
}
</script>

<style>

</style>
